Skip to content

Instantly share code, notes, and snippets.

@jschoch
Last active March 20, 2024 13:59
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save jschoch/776b45ec1498fec6dc9facb128e22b09 to your computer and use it in GitHub Desktop.
Save jschoch/776b45ec1498fec6dc9facb128e22b09 to your computer and use it in GitHub Desktop.
linuxcnc max_velocity settings

The below explaination was generated by google gemini

Understanding max_velocity Settings in LinuxCNC

This guide explains how various max_velocity settings interact in LinuxCNC's .ini configuration file, focusing on the [traj], [axis], and [joint] sections, and their relationship with stepgen_maxvel.

max_velocity in Different Sections:

  • [traj] Section:

    • DEFAULT_LINEAR_VELOCITY (or DEFAULT_VELOCITY): Sets the default speed for linear jogs (straight-line movements) in machine units per second (default starting point for manual jogging).
    • MAX_LINEAR_VELOCITY: Defines the absolute maximum velocity for any linear movement (including jogs, G-code commands, and coordinated moves). This acts as a hard limit for safety.
  • [axis] Section:

    • MAX_VELOCITY: Specifies the maximum velocity for a specific axis, also in machine units per second. Allows tailoring speed for each axis based on its limitations. This value should generally be lower than or equal to the global MAX_LINEAR_VELOCITY in [traj].
  • [joint] Section (Rotary Axes):

    • MAX_VELOCITY: Similar to the axis section, this sets the maximum velocity for a rotary axis, again in units per second (e.g., degrees or radians per second).

Interaction with stepgen_maxvel:

  • stepgen_maxvel (found in [EMC]) is an internal parameter for the step generator used by stepper motors. It defines the maximum step rate the step generator can handle (typically in encoder steps per second).

Relationship Between max_velocity and stepgen_maxvel:

  • LinuxCNC uses max_velocity values and the machine's physical properties to calculate the required step rate for each axis.
  • Internally, it converts the desired max_velocity to steps per second and compares it to stepgen_maxvel.
  • If the calculated step rate exceeds stepgen_maxvel, LinuxCNC reduces max_velocity to a level that doesn't overload the step generator, potentially sacrificing some speed for stability.

Key Points:

  • MAX_LINEAR_VELOCITY in [traj] sets the overall limit for linear movements.
  • MAX_VELOCITY in [axis] allows for axis-specific speed adjustments.
  • MAX_VELOCITY in [joint] is for rotary axes, expressed in appropriate units.
  • stepgen_maxvel is an internal limit for stepper motors.
  • LinuxCNC ensures max_velocity doesn't exceed stepper motor capabilities.

Additional Considerations:

  • Actual achieved velocity can be further limited by factors like acceleration settings, machine dynamics, and real-time constraints.
  • It's generally recommended to keep max_velocity values conservative for smoother operation and reduced wear.
  • Adjust these settings cautiously, starting with lower values and gradually increasing them while observing machine behavior.

By understanding these concepts, you can effectively configure your LinuxCNC system for optimal performance and safety within your hardware's constraints.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment